<template>
	<view class="bg-white">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">定岗定编详情</block>
			<block slot="right">
				<button class="cu-btn bg-blue shadow" @click="save">保存</button>
			</block>
		</cu-custom>
		<view class="cu-bar bg-white solid-bottom">
			<view class="action">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text> 定岗定编
			</view>
		</view>
		<view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					部门
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.company_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					公司
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.company}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					岗位
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.post}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					职务
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.depart}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					身份类别
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.postType_dictText}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					编制人数
				</view>
				<view style="border: 1rpx solid;" class="flex-sub padding-sm margin-xs radius">
					<input v-model="dataObj.demandWorker" />
				</view>
			</view>
		</view>
		<view class="cu-bar bg-white solid-bottom">
			<view class="action">
				<text class="cuIcon-titles " style="color: #1E5EFF;"></text>在职情况
			</view>
		</view>
		<view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					在职人数
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.onJobWorker}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					缺编人数
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{dataObj.shortageWorker}}
				</view>
			</view>
		</view>
		<view v-for="(item, index) in dataObj.onJobEmployees" :key="index" class="solid-bottom margin-bottom-sm">
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					在职员工
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{item.realname}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					员工工号
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{item.workNo}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					身份证号码
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{item.idCard}}
				</view>
			</view>
			<view class="flex">
				<view class="flex-sub padding-sm margin-xs radius">
					联系电话
				</view>
				<view class="flex-sub padding-sm margin-xs radius">
					{{item.phone}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import moment from 'moment';
	export default {
		data() {

			return {
				id: Math.floor(Math.random() * 10000000000000000000) + Date.now(),
				dataObj: {},
				editId: '',
				model: {

				},
			}
		},
		mounted() {

		},
		computed: {

		},
		onLoad: function(options) {
			if (options.positionStaffingObj) {
				this.dataObj = JSON.parse(options.positionStaffingObj);
			}
		},
		methods: {
			save() {
				this.$http.post('/crm_position_staffing/crmPositionStaffing/editPositionStaffing', this.dataObj)
					.then(res => {
						if (res.data.success) {
							uni.navigateTo({
								url: '/pages/positionStaffingTable/index'
							})
						} else {
							this.$tip.toast(res.data.message)
						}
					}).catch(() => {
						this.$tip.loaded();
						this.$tip.toast('提交失败')
					});
			},
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 100%;
		height: 100%;
	}

	.blackList {
		height: 100%;
		overflow: hidden;
	}

	.page-search {
		padding-left: 34rpx;
		margin-bottom: 12rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.search {
		width: 680rpx;
		height: 86rpx;
		background-color: rgba(249, 249, 249, 1);
		border-radius: 60rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding-left: 24rpx;
		padding-right: 24rpx;

		.search-left {
			width: 28rpx;
			height: 28rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.search-center {
			margin-left: 22rpx;
		}

		.search-placeholder {
			font-size: 28rpx;
			font-weight: 400;
			color: #7C7C7C;
		}


	}

	.filter-btn {
		width: 40rpx;
		height: 40rpx;
		margin-right: 42rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.page-content-main {
		height: calc(100% - 12rpx - 86rpx);
		border-top-left-radius: 64rpx;
		border-top-right-radius: 64rpx;
		padding: 26rpx 34rpx 0 34rpx
	}

	.select-box {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;

	}

	.select {
		width: 160rpx;
		height: 74rpx;
		border-radius: 60rpx;
		background-color: #4591FE;
		margin-bottom: 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		margin-right: 48rpx;
		position: relative;

		.select-value {
			font-size: 28rpx;
			font-weight: 400;
			color: #FFFFFF;
			margin-right: 18rpx;
		}

		.select-icon {
			width: 22rpx;
			height: 22rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			right: 20rpx;
			top: 25rpx;
		}
	}

	.list {
		height: calc(100% - 74rpx - 20rpx);
	}

	.list-item {
		border-radius: 28rpx;
		background-color: #FFFFFF;
		padding: 26rpx 24rpx 28rpx 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		margin-bottom: 26rpx;
		position: relative;

		.list-item-leftCenter {
			display: flex;
			flex-direction: row;
		}

		.list-item-left {
			width: 86rpx;
			height: 86rpx;
			margin-right: 26rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.list-item-center {
			.list-item-row {
				display: flex;
				flex-direction: row;
				margin-bottom: 20rpx;

				.list-item-name {
					color: #101317;
					font-size: 32rpx;
					margin-right: 16rpx;
				}

				.list-item-sex {
					width: 106rpx;
					height: 42rpx;
					border-top-right-radius: 40rpx;
					border-bottom-right-radius: 40rpx;
					border-bottom-left-radius: 20rpx;
					background-color: rgba(234, 171, 78, 0.35);
					line-height: 42rpx;
					text-align: center;
					color: rgba(255, 173, 4, 1);
					font-size: 24rpx;
				}

				.list-item-row-icon {
					width: 38rpx;
					height: 38rpx;
					margin-right: 10rpx;
					display: flex;
					justify-content: center;
					align-items: center;
				}

				.list-item-row-title,
				.list-item-row-value {
					font-size: 24rpx;
					font-weight: 400;
					color: #101317;
					line-height: 38rpx;
				}

			}
		}

		.list-item-btn {
			width: 36rpx;
			height: 36rpx;
			margin-top: 56rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.list-item-tab {
			width: 132rpx;
			height: 56rpx;
			text-align: center;
			line-height: 56rpx;
			background-color: rgba(69, 145, 254, 0.4);
			position: absolute;
			top: 0;
			right: 0;
			border-top-right-radius: 26rpx;
			border-bottom-left-radius: 20rpx;
		}

		.list-item-tab-text {
			font-size: 26rpx;
			color: rgba(69, 145, 254, 1)
		}
	}

	.nav-right-image {
		width: 80rpx;
		height: 80rpx;
		margin-left: 15px;
	}

	.cu-form-group {
		background-color: transparent;
	}

	::v-deep {
		.cu-form-group uni-picker .picker {
			color: #FFFFFF;
		}

		.cu-form-group uni-picker::after {
			opacity: 0;
		}
	}

	.textView {
		margin-left: 25px;
		font-size: 10px;
		margin-top: 5px;
	}

	.listText {
		width: 148rpx;
		height: 24rpx;
		font-size: 20rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #000000;
		line-height: 24rpx;
	}
</style>